package cn.iocoder.yudao.module.system.controller.admin.exam.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 测评答案提交请求 VO
 *
 * @author 芋道源码
 */
@Schema(description = "管理后台 - 测评答案提交请求 VO")
@Data
public class ExamAnswerSubmitReqVO {



    @Schema(description = "测评类型标记值", example = "exam_type_1")
    private String tbl;

    @Schema(description = "报告类型，默认3。1：基础版报告；2：专业版报告；3：完整版报告", example = "3")
    private String reportType = "3";

    @Schema(description = "是否提交所有题目的答案，默认0。0：否，1：是", example = "0")
    private String isAllAnswer = "0";

    @Schema(description = "答案列表", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "答案列表不能为空")
    private List<ExamAnswerItemVO> answers;

    @Schema(description = "测评答案项 VO")
    @Data
    public static class ExamAnswerItemVO {

        @Schema(description = "题目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        @NotNull(message = "题目ID不能为空")
        private Long detailsId;

        @Schema(description = "答案选项索引值，从0开始", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
        @NotNull(message = "答案选项索引值不能为空")
        private Integer answerIndex;

    }

}
